package day24.edu;

import java.util.Iterator;
import java.util.TreeSet;

// Created: 24/09/2025, ChangJiang Ru
public class TreeSetTest {
    public static void main(String[] args) {
        TreeSet treeSet = new TreeSet();

        treeSet.add(new User("Tom", 12));
        treeSet.add(new User("Jerry", 78));
        treeSet.add(new User("Helli", 34));
        treeSet.add(new User("Jack", 45));
        treeSet.add(new User("Rose", 24));

        Iterator iterator = treeSet.iterator();

        while(iterator.hasNext())
        {
            System.out.println(iterator.next());
        }
    }
}
